/*
 * 文件名：OAHandleServiceImpl.java
 * 版权：Copyright by www.tiansu-china.com/
 * 描述：
 * 修改人：congriran
 * 修改时间：2020年11月26日
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
*/

package com.tiansu.reborn.wanda.modules.executor.service.impl;

import java.sql.Timestamp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tiansu.reborn.wanda.modules.executor.dao.OAHandleDao;
import com.tiansu.reborn.wanda.modules.executor.entity.OAHandleEntity;
import com.tiansu.reborn.wanda.modules.executor.service.OAHandleService;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class OAHandleServiceImpl extends ServiceImpl<OAHandleDao, OAHandleEntity> implements OAHandleService
{
    @Autowired
    private OAHandleDao oaHanleDao;

    @Override
    public OAHandleEntity select(String businessId)
    {
        OAHandleEntity entity = oaHanleDao.getEntityByBid(businessId);
        if (null == entity)
        {
            return null;
        }
        else
        {
            entity.setStrField(entity);
            return entity;
        }
    }

    @Override
    public int statusRepair(String businessId, Integer approveType)
    {
        log.debug("StatusRepair BusinessId: " + businessId + ", approveType: " + approveType);
        Timestamp launchUpdateTime = new Timestamp(System.currentTimeMillis());
        return oaHanleDao.updateApproveTypeByBid(businessId, approveType, launchUpdateTime);
    }
}
